/**
 *  login control
 *
 *  @author : jihuaizhi
 *  @Time   : 2010.03.22 21:08:10 CST
 *  @note   :
 */
package com.basestone.pdlmis.control
{
    import com.basestone.pdlmis.vo.User;
    import com.basestone.pdlmis.model.*;

    import mx.core.Application;

    public class LoginControl implements ControlBase
    {

        private var loginModel:LoginModel;

        public function LoginControl():void
        {
            loginModel=ModelFactory.getModel(ModelFactory.LOGIN_MODEL) as LoginModel;
        }

        public function loginRequest(userName:String, password:String):void
        {
//			loginModel.loginRequest(userName,password);
//************************DEMO******************************************			
            Application.application.user=new User();
            Application.application.user.name="基怀志";
            Application.application.user.isAdmin=true;
            Application.application.user.type=0;
            Application.application.MainView.Main_WelcomeView.openView();
            Application.application.MainView.Top_UserNameText.text=Application.application.user.name;
//************************DEMO******************************************			

        }

        public function logoutRequest():void
        {
//			loginModel.logoutRequest();
//************************DEMO******************************************			
            Application.application.MainView.Main_LoginView.openView();
//************************DEMO******************************************			
        }
    }
}